/*======================================
                模版
=====================================*/
function moments_list_template(v) {
    var html = '<div class="item"  data-id="' + v.id + '">';
    if (v.single) {
        html += '<div class="userbox"><a class="nick" href="/m/single/info/' + v.single.userId + '">';
        html += '    <div class="photo"><img src="' + v.single.photo + '_200x200.jpg"></div>';
        html += '    <div class="nickname">' + v.single.nickname + ' <span class="icon gender_' + v.single.gender + '"></span></div>';
        html += '    <div class="userinfo">';
        html += '       <span>' + v.single.age + '岁</span>';
        if (v.single.height) html += '       <span> . </span><span>' + v.single.height + 'cm</span>';
        if (v.single.constellationCn) html += '       <span> . </span><span>' + v.single.constellationCn + '</span>';
        html += '    </div>';
        html += '</a></div>';
    }
    else {
        html += '<div class="ub-f1 singlenull info">用户不存在或已删除～</div>';
    }
    html += '<div class="speak">';
    html += '    ' + v.content + '';
    html += '</div>';
    if (v.mediaType != undefined && v.mediaType == "image") {
        var pics = v.media.split(',');
        html += '<div class="picbox num_' + pics.length + '">';
        for (var i in pics) {
            var item = pics[i];
            if (item == "") {
                continue;
            }
            html += '<div class="pic"><img src="' + item + '_600x600.jpg" big-src="' + item + '_1000x1000.jpg" sm-src="' + item + '_200x200.jpg"></div>';
        }
        html += '</div>';
    } else if (v.mediaType != undefined && v.mediaType == "video") {
        html += '<div class="videobox"><video class="video"  x5-video-player-type="h5-page" controls="controls" preload="none" src="' + v.media + '"></video></div>';
    }
    if (v.location) {
        html += '<div class="location"><font>' + v.location + '</font></div>';
    }
    html += '';
    html += '<div class="info">';
    html += '    <div class="left">';
    html += '        <span class="create">' + bottlecms.getDateDiff(bottlecms.microtime(v.createTime)) + '</span> ';
    if (v.issuer) html += '        <a class="delete js-del" href="javascript:;"  data-id="' + v.id + '">删除</a>';
    html += '    </div>';
    html += '    <div class="right">';
    html += '        <span class="praise ' + (v.existsPraise == true ? "on" : "") + ' js-praise" data-id="' + v.id + '">' + v.praise + '</span>';
    html += '        <span class="comment js-comment" data-id="' + v.id + '">' + v.comments + '</span>';
    html += '    </div>';
    html += '</div>';
    if ((v.praises && v.praises.length > 0) || (v.commentList && v.commentList.length > 0)) {
        html += '<div class="comments_or_praises">';
        if (v.praises && v.praises.length > 0) {
            html += '<div class="praises"><i class="icon-heart"></i> ';
            for (var o in v.praises) {
                var praise = v.praises[o];
                if (praise) html += '<a class="nick" href="/m/single/info/' + praise.userId + '"><img class="photo" src="' + praise.photo + '_50x50.jpg">' + '</a>';
                // if(v.praises.length >o+1)html+="，";
            }
            html += '</div>';
        }
        if (v.praises && v.commentList && v.praises.length > 0 && v.commentList.length > 0) {
            html += '<div class="hr"></div>';
        }
        if (v.commentList && v.commentList.length > 0) {
            html += '<div class="comments">';
            for (var o in v.commentList) {
                var comment = v.commentList[o];
                if (comment) html += '<div class="comment-item "><a class="nick" href="/m/single/info/' + comment.userId + '">' + comment.nickname + '：</a>' + comment.content + '</div>';
            }
            html += '</div>';
        }
        html += '</div>';
    }
    html += '</div>';
    return html;
}

/*======================================
                页面
=====================================*/
